#ifndef CONNECTOR_H
#define CONNECTOR_H

#include <QDialog>
#include <QLineEdit>
#include <QPushButton>
#include "erl3.h"
#include <QErrorMessage>
#include "zookeper.h"
#include <QGraphicsScene>
#include "hexitem.h"

class Connector : public QDialog
{
    Q_OBJECT
public:
    Connector(QWidget *parent = 0);
    Common *common;
    Myerl *myerl;

    void createMeadow(int number);
    void play();
    void stop();
    void pause();
    void newThingy(const int x, const int y, const int type, const int spawnW, const int minW, const int weight, const int speed);
private:
    QLineEdit *cookie;
    QLineEdit *host;
    QLineEdit *name;
    QPushButton *actConnect, *actCancel;

    QString *sName,*sHost,*sCookie;
    QErrorMessage *cError;
    void loadDefault();
    void saveDefault(std::string _cookie, std::string _name, std::string _host);
public slots:

private slots:
    int connectErl();
    void cancel();
};

#endif // CONNECTOR_H
